<?php 
namespace App\Controllers;
use App\Models\User;

class IndexController
{
	public function index()
	{
		return $this->start();
	}
	private function start()
	{
		$user = User::where('is_delete', 0)->orderBy('id', 'desc')->get();
		// $user = User::where('is_delete', 0)->orderBy('id', 'desc')->take(3)->get(['username', 'phone']);
		// return 'Hello,控制器';
		// return json_encode(["data" => $user, "rv" => 200], JSON_UNESCAPED_UNICODE);
		// return json_encode(["data" => $user, "rv" => 200], JSON_UNESCAPED_SLASHES);
		return json_encode(["data" => $user, "rv" => 200, "text" => $router]);
	}
	public function hello($request)
	{
		return json_encode(["rv" => 200, "text" => $request]);
	}
}